package cn.wx.scholar.neo4j.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.wx.common.persistence.base.BaseController;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.neo4j.entity.qo.Neo4jPatentsQ;
import cn.wx.scholar.neo4j.service.Neo4jPatentsService;

@RestController
@RequestMapping("/sholar/neo4j/patents")
public class Neo4jPatentsController extends BaseController {
	@Autowired
    private Neo4jPatentsService neo4jPatentsService;
	
	/**
	 * 根据专家的Id获取该专家所有的专利数据
	 * @param id
	 * @return
	 */
    @RequestMapping(value = "/getPatentsById", method = RequestMethod.POST)
	public ResponseData getPatentsById(Neo4jPatentsQ neo4jPatentsQ){
		return success(neo4jPatentsService.getPapersByExpertId(neo4jPatentsQ));
    }
    
    /**
	 * 根据专利的Id获取该专利的详情数据
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/findOnePatents", method = RequestMethod.POST)
	public ResponseData findOnePatents(@RequestParam(value = "id") Long id) {
		return success(neo4jPatentsService.findOnePatents(id));
	}
}
